<template>
  <div>
    <ul ref="pannel" class="goods-list">
      <li v-for="item in list" :key="item.id" :style="{ background: bg }">
        <RouterLink to="/">
          <img v-imgLazy="item.picture" :src="load" alt="" />
          <p class="name">{{ item.name || item.title }}</p>
          <p :class="{ price: item.price, desc: item.alt }">
            {{ item.alt || "&yen;" + item.price }}
          </p>
        </RouterLink>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default: () => []
    },
    bg: {
      type: String,
      default: '#f0f9f4'
    }
  }
}
</script>

<style lang="less" scoped>
.goods-list {
  display: flex;
  justify-content: space-between;
  height: 406px;
  li {
    width: 306px;
    height: 406px;
    background: #f0f9f4;
    // 激活效果
    transition: all 0.5s;
    &:hover {
      transform: translate3d(0, -6px, 0);
      box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
    }
    // end
    img {
      width: 306px;
      height: 306px;
    }
    p {
      font-size: 22px;
      padding-top: 12px;
      text-align: center;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
    }
    .price {
      color: @priceColor;
    }
    .desc {
      color: #999;
      font-size: 18px;
    }
  }
}
</style>
